cmake_minimum_required(VERSION 3.6)
project(QTextAnalyze)


if (APPLE)
    set (CMAKE_PREFIX_PATH "/usr/local/opt/qt5/lib/cmake")
endif ()

set(CMAKE_INCLUDE_CURRENT_DIR  ON)
set(CMAKE_VERBOSE_MAKEFILE ON)

#打开Qt的MOC功能和UI文件处理功能
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)

#查找Qt的库
# Find the QtWidgets library
find_package(Qt5Widgets)


add_subdirectory(core)
add_subdirectory(ui)

set(SOURCE_FILES main.cpp mainwindow.cpp mainwindow.h mainwindow.ui)
add_executable(QTextAnalyze ${SOURCE_FILES})

qt5_use_modules(QTextAnalyze Widgets)

target_link_libraries(QTextAnalyze CORE_SERVICE UI)